﻿ /**
* Enter description here
*
* @usage
* @return
*/
import mx.utils.Delegate;
class ParseXML
{
	public var xml_array : Array;
	private var myxml : XML;

	public function ParseXML (url:String)
	{
		myxml = new XML ();
		myxml.ignoreWhite = true;
		
		myxml.onLoad = Delegate.create (this, onLoadEvent);
		myxml.load(url);
	}
	function onLoadEvent (success : Boolean) : Void
	{
		if (success)
		{
			trace ("parse xml fine.")
			xml_array = myxml.firstChild.childNodes;
			output ();
		}
	}
	public function output ()
	{
		trace ('xml_array: ' + xml_array.length);
		trace("=======================");
		for (var i = 0; i < xml_array.length; i ++)
		{
			trace (i+" : "+xml_array[i].nodeName);
		}
	}
}
